/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ventanaPrincipal.java
 *
 * Created on 18/03/2014, 17:39:23
 */
package ventanas;

import clases.ImagenFondo;
import java.awt.Dimension;
import java.awt.Image;
import java.awt.Toolkit;

/**
 *
 * @author x
 */
public class VentanaPrincipal extends javax.swing.JFrame {

    /** Creates new form ventanaPrincipal */
    
    public VentanaPrincipal() {
        super("   SiHospi - Sistema Estadístico de Hospitalización");
        initComponents();
               
        //Mostrar imagen de fondo.
        jDesktopPane1.setBorder(new ImagenFondo());
        
        //Tamaño de la ventana principal.
        setSize(750, 650);
               
        //Obtenemos la resolución de la pantalla para determinar la
        //posición de la ventana principal.
        Dimension pantalla = Toolkit.getDefaultToolkit().getScreenSize();
        int alto = pantalla.height;
        int ancho = pantalla.width;
        setLocation((ancho/7),(alto/55));
               
        pack();
    }
    
    
    
     //Metodo que permite colocar imagen de fondo en el sistema.
    @Override
    public Image getIconImage(){
        Image retValue=Toolkit.getDefaultToolkit().
               getImage(ClassLoader.getSystemResource("imagenes/oficina.png"));
        return retValue;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane1 = new javax.swing.JDesktopPane();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setIconImage(getIconImage());
        setMinimumSize(new java.awt.Dimension(750, 650));
        setResizable(false);

        jDesktopPane1.setBackground(new java.awt.Color(0, 102, 102));
        jDesktopPane1.setForeground(new java.awt.Color(204, 204, 204));
        getContentPane().add(jDesktopPane1, java.awt.BorderLayout.CENTER);

        jMenuBar1.setBackground(new java.awt.Color(204, 204, 204));

        jMenu1.setText("Ingresar informe ");
        jMenuBar1.add(jMenu1);

        jMenu2.setText("Ingresar recurso");
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new VentanaPrincipal().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    // End of variables declaration//GEN-END:variables
}
